package com.loveazure.main;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;

import com.loveazure.bll.Handler;
import com.loveazure.bll.Operation;
import com.loveazure.ui.MainFrame;
import com.loveazure.ui.MainFrame.Status;

public class Startup {

	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {

				// try {
				// UIManager
				// .setLookAndFeel(new
				// SubstanceBusinessBlackSteelLookAndFeel());
				// } catch (UnsupportedLookAndFeelException e) {
				// e.printStackTrace();
				// }
				// initGlobalFontSetting(new Font("Dialog", Font.PLAIN, 12));

				try {
					UIManager.setLookAndFeel(UIManager
							.getInstalledLookAndFeels()[1].getClassName());
				} catch (Exception e) {
					e.printStackTrace();
				}

				Handler handler = Handler.getInstance();

				Operation oper = new Operation();
				handler.setOper(oper);

				MainFrame frame = new MainFrame();
				handler.setFrame(frame);

				frame.switchPanel(Status.LOGIN);
				frame.setVisible(true);
			}
		});

	}

	// public static void initGlobalFontSetting(Font fnt) {
	// FontUIResource fontRes = new FontUIResource(fnt);
	// for (Enumeration keys = UIManager.getDefaults().keys(); keys
	// .hasMoreElements();) {
	// Object key = keys.nextElement();
	// Object value = UIManager.get(key);
	// if (value instanceof FontUIResource)
	// UIManager.put(key, fontRes);
	// }
	// }

}
